package com.dunke.core.enums;

public enum ReturnCode {

    SUCCESS(200,"操作成功",true),
    ERROR(201,"操作失败",false),
    NOT_PERMISSION(202,"未取得该权限",false),

    //1注册密码相关
    USER_HAVE_EXIST(211,"用户已存在", false),
    PASSWORD_NOT_SAME(212,"两次密码输入不相同", false),
    PASSWORD_NULL_OLD(213,"旧密码不能为空", false),
    SAME_NICK(214,"用户昵称已存在", false),
    NO_INVITATION_CODE(215,"无该邀请码", false),

    //2 登录相关
    USER_NOT_EXIST(220,"用户不存在", false),
    USER_FREEZE(221,"用户被冻结，请联系客服！", false),
    USER_PASS_ERROR(222,"密码不正确", false),
    USER_LOGIN_FAIL(223,"登陆失败", false),
    USER_NOT_LOGIN(224,"用户未登录", false),
    USER_TOKEN_UNUSUAL(225,"token异常", false),
    USER_TOKEN_EXPIRE(226,"token过期", false),
    USER_TYPE_EXPIRE(227,"登录方式错误", false),


    //5 内部错误相关
    UN_VAILD_PARAM(230,"上传参数不正确",false),
    UNUSUAL(231,"服务器内部异常，请重试",false),
    UPDATE_ERROR(232,"数据更新失败",false),
    NO_INFO(233, "暂无数据",false),
    FREQUENTLY(234,"接口请求太过频繁，请重试",false),
    GET_YZM_ERROR(235,"验证码请求失败",false),
    CODE_VALID_ERROR(236,"验证码校验失败",false),
    SIGN_ERROR(237,"签名错误",false),
    YZM_VALID_EMPTY(238,"请重新获取验证码",false);

    private Integer code;
    private String message;
    private boolean success;

    ReturnCode(Integer code, String message, boolean success) {
        this.code = code;
        this.message = message;
        this.success = success;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }
}
